//
//  YQSettingViewController.swift
//  yq微信
//
//  Created by yq on 2017/8/25.
//  Copyright © 2017年 yq. All rights reserved.
//

import UIKit

class YQSettingViewController: UIViewController {

    // 隐藏tabbar
    override func viewDidLoad() {
        super.viewDidLoad()

//        self.navigationController?.tabBarController?.tabBar.isHidden = true
        self.tabBarController?.tabBar.isHidden = true
    }

     // 取消tabbar隐藏
    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
        self.tabBarController?.tabBar.isHidden = false

//        self.navigationController?.tabBarController?.tabBar.isHidden = false
    }
    
    
    // 推出登录账户-->切换回登录界面
    @IBAction func LogOff() {
        
        print("切换回登录界面")
        
        EMClient.shared().logout(false) { (error ) in
            if error==nil {
                print("退出成功")
            
                // 切换控制器
                let window = UIApplication.shared.keyWindow
                window?.rootViewController = YQLoginViewController.getLoginVC()
                
            }
        }
    }

}
